Asset association with Functional Location
Introduction
An asset may be associated with only one Functional Location.
The following Assetic REST API's are available to support association and dissociation.
-
GET /api/v2/assets/{id}/functionallocation
-
Get an associated functional location of an asset
-
-
PUT /api/v2/assets/{id}/functionallocation
-
Associate an asset with a functional location
-
-
DELETE /api/v2/assets/{id}/functionallocation
-
Disassociate an asset from a functional location
-
Get Associated Functional Location of an Asset
For a given asset the Functional Location is returned by the Assetic REST API GET /api/v2/assets/{id}/functionallocation, where {id} is either the user friendly Asset Id, or the Assetic internal asset GUID.
Sample GET Request
Request URL (user friendly asset Id)
The following example will get the functional location for the asset with user-friendly asset Id='ABAB'
https://[your_site].assetic.net/api/v2/assets/ABAB/functionallocation
Request URL (asset GUID)
The following example will get the functional location for the asset with Assetic asset GUID='a300ad8e-9a53-e611-9467-06edd62954d7'
https://[your_site].assetic.net/api/v2/assets/a300ad8e-9a53-e611-9467-06edd62954d7/functionallocation
Response
The response status code is 200 with the following body:
{ "Id": "0eced6fd-3c94-495b-bdf2-13a6493eb87d", "FunctionalLocationId": "SUB25051", "FunctionalLocationName": "Emerton", "_links": [], "_embedded": null }
Response (if no association)
If the asset is not associated with a Functional Location then the response status code is 200 with the following body:
{ "Id": "00000000-0000-0000-0000-000000000000", "FunctionalLocationId": "null", "FunctionalLocationName": "null", "_links": [], "_embedded": null }
Associate Asset with Functional Location
An asset may be associated with a given Functional Location via the Assetic REST API endpoint PUT /api/v2/assets/{id}/functionallocation, where {id} is either the user friendly Asset Id, or the Assetic internal asset GUID.
If the asset is already associated with a different Functional Location the existing association will be removed and the asset associated with the functional Location specified in the request payload. This is because an asset may only be associated with a single Functional Location.
The GUID of the Functional Location may be obtained via the Functional Location GET API's as described in the Assetic Knowledge Base article Retrieve Functional Locations.
Sample PUT Request
The following PUT request will associate the asset with Id "ABAB" to the Functional Location with GUID "0eced6fd-3c94-495b-bdf2-13a6493eb87d"
Request URL
https://[your_site].assetic.net/api/v2/assets/ABAB/functionallocation
Request Body
{
"Id": "0eced6fd-3c94-495b-bdf2-13a6493eb87d"
}
Response
If successful the response status code is 200.
{ "Id": "0eced6fd-3c94-495b-bdf2-13a6493eb87d", "FunctionalLocationId": "SUB25051", "FunctionalLocationName": "Emerton", "_links": [], "_embedded": null }
Asset Disassociation from Functional Location
An asset may be disassociated from a Functional Location via the Assetic REST API endpoint DELETE /api/v2/assets/{id}/functionallocation, where {id} is either the user friendly Asset Id, or the Assetic internal asset GUID.
Sample DELETE Request
The following example will remove the association between the asset with GUID "a300ad8e-9a53-e611-9467-06edd62954d7" and the Functional Location it is associated with.
Request URL (asset GUID)
https://[your_site].assetic.net/api/v2/assets/a300ad8e-9a53-e611-9467-06edd62954d7/functionallocation
Response
If successful the response status code is 200. There is no response body.